3.1.16 \(\int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx\) [16]

3.1.16.1 Optimal result
3.1.16.2 Mathematica [B] (warning: unable to verify)
3.1.16.3 Rubi [A] (verified)
3.1.16.4 Maple [B] (verified)
3.1.16.5 Fricas [B] (verification not implemented)
3.1.16.6 Sympy [F]
3.1.16.7 Maxima [B] (verification not implemented)
3.1.16.8 Giac [F]
3.1.16.9 Mupad [F(-1)]

3.1.16.1 Optimal result

Integrand size = 20, antiderivative size = 288 \[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\frac {5 i (c+d x)^3}{3 a^2 f}+\frac {(c+d x)^4}{4 a^2 d}-\frac {10 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}+\frac {20 i d^2 (c+d x) \operatorname {PolyLog}\left (2,-e^{i (e+f x)}\right )}{a^2 f^3}-\frac {20 d^3 \operatorname {PolyLog}\left (3,-e^{i (e+f x)}\right )}{a^2 f^4}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}-\frac {5 (c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \]

output
5/3*I*(d*x+c)^3/a^2/f+1/4*(d*x+c)^4/a^2/d-10*d*(d*x+c)^2*ln(1+exp(I*(f*x+e 
)))/a^2/f^2+4*d^3*ln(cos(1/2*f*x+1/2*e))/a^2/f^4+20*I*d^2*(d*x+c)*polylog( 
2,-exp(I*(f*x+e)))/a^2/f^3-20*d^3*polylog(3,-exp(I*(f*x+e)))/a^2/f^4-1/2*d 
*(d*x+c)^2*sec(1/2*f*x+1/2*e)^2/a^2/f^2+2*d^2*(d*x+c)*tan(1/2*f*x+1/2*e)/a 
^2/f^3-5/3*(d*x+c)^3*tan(1/2*f*x+1/2*e)/a^2/f+1/6*(d*x+c)^3*sec(1/2*f*x+1/ 
2*e)^2*tan(1/2*f*x+1/2*e)/a^2/f
 
3.1.16.2 Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(1447\) vs. \(2(288)=576\).

Time = 7.95 (sec) , antiderivative size = 1447, normalized size of antiderivative = 5.02 \[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx =\text {Too large to display} \]

input
Integrate[(c + d*x)^3/(a + a*Sec[e + f*x])^2,x]
 
output
(((-20*I)/3)*d^3*Cos[e/2 + (f*x)/2]^4*(f^2*x^2*(f*x - (3*I)*(1 + E^(I*e))* 
Log[1 + E^((-I)*(e + f*x))]) + 6*(1 + E^(I*e))*f*x*PolyLog[2, -E^((-I)*(e 
+ f*x))] - (6*I)*(1 + E^(I*e))*PolyLog[3, -E^((-I)*(e + f*x))])*Sec[e/2]*S 
ec[e + f*x]^2)/(E^((I/2)*e)*f^4*(a + a*Sec[e + f*x])^2) + (16*d^3*Cos[e/2 
+ (f*x)/2]^4*Sec[e/2]*Sec[e + f*x]^2*(Cos[e/2]*Log[Cos[e/2]*Cos[(f*x)/2] - 
 Sin[e/2]*Sin[(f*x)/2]] + (f*x*Sin[e/2])/2))/(f^4*(a + a*Sec[e + f*x])^2*( 
Cos[e/2]^2 + Sin[e/2]^2)) - (40*c^2*d*Cos[e/2 + (f*x)/2]^4*Sec[e/2]*Sec[e 
+ f*x]^2*(Cos[e/2]*Log[Cos[e/2]*Cos[(f*x)/2] - Sin[e/2]*Sin[(f*x)/2]] + (f 
*x*Sin[e/2])/2))/(f^2*(a + a*Sec[e + f*x])^2*(Cos[e/2]^2 + Sin[e/2]^2)) - 
(80*c*d^2*Cos[e/2 + (f*x)/2]^4*Csc[e/2]*((f^2*x^2)/(4*E^(I*ArcTan[Cot[e/2] 
])) - (Cot[e/2]*((I/2)*f*x*(-Pi - 2*ArcTan[Cot[e/2]]) - Pi*Log[1 + E^((-I) 
*f*x)] - 2*((f*x)/2 - ArcTan[Cot[e/2]])*Log[1 - E^((2*I)*((f*x)/2 - ArcTan 
[Cot[e/2]]))] + Pi*Log[Cos[(f*x)/2]] - 2*ArcTan[Cot[e/2]]*Log[Sin[(f*x)/2 
- ArcTan[Cot[e/2]]]] + I*PolyLog[2, E^((2*I)*((f*x)/2 - ArcTan[Cot[e/2]])) 
]))/Sqrt[1 + Cot[e/2]^2])*Sec[e/2]*Sec[e + f*x]^2)/(f^3*(a + a*Sec[e + f*x 
])^2*Sqrt[Csc[e/2]^2*(Cos[e/2]^2 + Sin[e/2]^2)]) + (Cos[e/2 + (f*x)/2]*Sec 
[e/2]*Sec[e + f*x]^2*(-24*c^2*d*f*Cos[(f*x)/2] - 48*c*d^2*f*x*Cos[(f*x)/2] 
 + 36*c^3*f^3*x*Cos[(f*x)/2] - 24*d^3*f*x^2*Cos[(f*x)/2] + 54*c^2*d*f^3*x^ 
2*Cos[(f*x)/2] + 36*c*d^2*f^3*x^3*Cos[(f*x)/2] + 9*d^3*f^3*x^4*Cos[(f*x)/2 
] - 24*c^2*d*f*Cos[e + (f*x)/2] - 48*c*d^2*f*x*Cos[e + (f*x)/2] + 36*c^...
 
3.1.16.3 Rubi [A] (verified)

Time = 0.92 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3042, 4679, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(c+d x)^3}{(a \sec (e+f x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(c+d x)^3}{\left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^2}dx\)

\(\Big \downarrow \) 4679

\(\displaystyle \int \left (-\frac {2 (c+d x)^3}{a^2 (\cos (e+f x)+1)}+\frac {(c+d x)^3}{a^2 (\cos (e+f x)+1)^2}+\frac {(c+d x)^3}{a^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {20 i d^2 (c+d x) \operatorname {PolyLog}\left (2,-e^{i (e+f x)}\right )}{a^2 f^3}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}-\frac {10 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}-\frac {5 (c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {5 i (c+d x)^3}{3 a^2 f}+\frac {(c+d x)^4}{4 a^2 d}-\frac {20 d^3 \operatorname {PolyLog}\left (3,-e^{i (e+f x)}\right )}{a^2 f^4}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}\)

input
Int[(c + d*x)^3/(a + a*Sec[e + f*x])^2,x]
 
output
(((5*I)/3)*(c + d*x)^3)/(a^2*f) + (c + d*x)^4/(4*a^2*d) - (10*d*(c + d*x)^ 
2*Log[1 + E^(I*(e + f*x))])/(a^2*f^2) + (4*d^3*Log[Cos[e/2 + (f*x)/2]])/(a 
^2*f^4) + ((20*I)*d^2*(c + d*x)*PolyLog[2, -E^(I*(e + f*x))])/(a^2*f^3) - 
(20*d^3*PolyLog[3, -E^(I*(e + f*x))])/(a^2*f^4) - (d*(c + d*x)^2*Sec[e/2 + 
 (f*x)/2]^2)/(2*a^2*f^2) + (2*d^2*(c + d*x)*Tan[e/2 + (f*x)/2])/(a^2*f^3) 
- (5*(c + d*x)^3*Tan[e/2 + (f*x)/2])/(3*a^2*f) + ((c + d*x)^3*Sec[e/2 + (f 
*x)/2]^2*Tan[e/2 + (f*x)/2])/(6*a^2*f)
 

3.1.16.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4679
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, 1/(Sin[e + f*x]^n/(b + a*Si 
n[e + f*x])^n), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && ILtQ[n, 0] && IGt 
Q[m, 0]
 
3.1.16.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 809 vs. \(2 (246 ) = 492\).

Time = 0.66 (sec) , antiderivative size = 810, normalized size of antiderivative = 2.81

method result size
risch \(\frac {d^{3} x^{4}}{4 a^{2}}+\frac {d^{2} c \,x^{3}}{a^{2}}+\frac {3 d \,c^{2} x^{2}}{2 a^{2}}+\frac {c^{3} x}{a^{2}}+\frac {c^{4}}{4 a^{2} d}+\frac {20 i d^{2} c e x}{a^{2} f^{2}}-\frac {2 i \left (6 d^{3} f^{2} x^{3} {\mathrm e}^{2 i \left (f x +e \right )}-6 i c \,d^{2} f x \,{\mathrm e}^{i \left (f x +e \right )}+18 c \,d^{2} f^{2} x^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 d^{3} f^{2} x^{3} {\mathrm e}^{i \left (f x +e \right )}-6 i c \,d^{2} f x \,{\mathrm e}^{2 i \left (f x +e \right )}-3 i c^{2} d f \,{\mathrm e}^{i \left (f x +e \right )}+18 c^{2} d \,f^{2} x \,{\mathrm e}^{2 i \left (f x +e \right )}+27 c \,d^{2} f^{2} x^{2} {\mathrm e}^{i \left (f x +e \right )}+5 d^{3} f^{2} x^{3}-3 i d^{3} f \,x^{2} {\mathrm e}^{i \left (f x +e \right )}-3 i d^{3} f \,x^{2} {\mathrm e}^{2 i \left (f x +e \right )}+6 c^{3} f^{2} {\mathrm e}^{2 i \left (f x +e \right )}+27 c^{2} d \,f^{2} x \,{\mathrm e}^{i \left (f x +e \right )}+15 c \,d^{2} f^{2} x^{2}-3 i c^{2} d f \,{\mathrm e}^{2 i \left (f x +e \right )}+9 c^{3} f^{2} {\mathrm e}^{i \left (f x +e \right )}+15 c^{2} d \,f^{2} x -6 d^{3} x \,{\mathrm e}^{2 i \left (f x +e \right )}+5 c^{3} f^{2}-6 c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-12 d^{3} x \,{\mathrm e}^{i \left (f x +e \right )}-12 c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}-6 d^{3} x -6 c \,d^{2}\right )}{3 f^{3} a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}-\frac {10 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) x^{2}}{a^{2} f^{2}}+\frac {10 i d^{2} c \,x^{2}}{a^{2} f}-\frac {20 d^{2} c e \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{3}}+\frac {10 i d^{3} x^{3}}{3 a^{2} f}-\frac {20 i d^{3} e^{3}}{3 a^{2} f^{4}}-\frac {10 i d^{3} e^{2} x}{a^{2} f^{3}}+\frac {20 i d^{2} c \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{3}}+\frac {4 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{a^{2} f^{4}}-\frac {4 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}-\frac {20 d^{3} \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}+\frac {20 i d^{3} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (f x +e \right )}\right ) x}{a^{2} f^{3}}-\frac {20 d^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) x}{a^{2} f^{2}}-\frac {10 d \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{a^{2} f^{2}}+\frac {10 d \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{2}}+\frac {10 d^{3} e^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}+\frac {10 i d^{2} c \,e^{2}}{a^{2} f^{3}}\) \(810\)

input
int((d*x+c)^3/(a+a*sec(f*x+e))^2,x,method=_RETURNVERBOSE)
 
output
1/4/a^2*d^3*x^4+1/a^2*d^2*c*x^3+3/2/a^2*d*c^2*x^2+1/a^2*c^3*x+1/4/a^2/d*c^ 
4+20*I/a^2/f^2*d^2*c*e*x-2/3*I*(6*d^3*f^2*x^3*exp(2*I*(f*x+e))-6*I*c*d^2*f 
*x*exp(I*(f*x+e))+18*c*d^2*f^2*x^2*exp(2*I*(f*x+e))+9*d^3*f^2*x^3*exp(I*(f 
*x+e))-6*I*c*d^2*f*x*exp(2*I*(f*x+e))-3*I*c^2*d*f*exp(I*(f*x+e))+18*c^2*d* 
f^2*x*exp(2*I*(f*x+e))+27*c*d^2*f^2*x^2*exp(I*(f*x+e))+5*d^3*f^2*x^3-3*I*d 
^3*f*x^2*exp(I*(f*x+e))-3*I*d^3*f*x^2*exp(2*I*(f*x+e))+6*c^3*f^2*exp(2*I*( 
f*x+e))+27*c^2*d*f^2*x*exp(I*(f*x+e))+15*c*d^2*f^2*x^2-3*I*c^2*d*f*exp(2*I 
*(f*x+e))+9*c^3*f^2*exp(I*(f*x+e))+15*c^2*d*f^2*x-6*d^3*x*exp(2*I*(f*x+e)) 
+5*c^3*f^2-6*c*d^2*exp(2*I*(f*x+e))-12*d^3*x*exp(I*(f*x+e))-12*c*d^2*exp(I 
*(f*x+e))-6*d^3*x-6*c*d^2)/f^3/a^2/(exp(I*(f*x+e))+1)^3-10/a^2/f^2*d^3*ln( 
exp(I*(f*x+e))+1)*x^2+10*I/a^2/f*d^2*c*x^2-20/a^2/f^3*d^2*c*e*ln(exp(I*(f* 
x+e)))+10/3*I/a^2/f*d^3*x^3-20/3*I/a^2/f^4*d^3*e^3-10*I/a^2/f^3*d^3*e^2*x+ 
20*I/a^2/f^3*d^2*c*polylog(2,-exp(I*(f*x+e)))+4/a^2/f^4*d^3*ln(exp(I*(f*x+ 
e))+1)-4/a^2/f^4*d^3*ln(exp(I*(f*x+e)))-20*d^3*polylog(3,-exp(I*(f*x+e)))/ 
a^2/f^4+20*I/a^2/f^3*d^3*polylog(2,-exp(I*(f*x+e)))*x-20/a^2/f^2*d^2*c*ln( 
exp(I*(f*x+e))+1)*x-10/a^2/f^2*d*c^2*ln(exp(I*(f*x+e))+1)+10/a^2/f^2*d*c^2 
*ln(exp(I*(f*x+e)))+10/a^2/f^4*d^3*e^2*ln(exp(I*(f*x+e)))+10*I/a^2/f^3*d^2 
*c*e^2
 
3.1.16.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 933 vs. \(2 (243) = 486\).

Time = 0.30 (sec) , antiderivative size = 933, normalized size of antiderivative = 3.24 \[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\frac {3 \, d^{3} f^{4} x^{4} + 12 \, c d^{2} f^{4} x^{3} - 12 \, c^{2} d f^{2} + 6 \, {\left (3 \, c^{2} d f^{4} - 2 \, d^{3} f^{2}\right )} x^{2} + 3 \, {\left (d^{3} f^{4} x^{4} + 4 \, c d^{2} f^{4} x^{3} + 6 \, c^{2} d f^{4} x^{2} + 4 \, c^{3} f^{4} x\right )} \cos \left (f x + e\right )^{2} + 12 \, {\left (c^{3} f^{4} - 2 \, c d^{2} f^{2}\right )} x + 6 \, {\left (d^{3} f^{4} x^{4} + 4 \, c d^{2} f^{4} x^{3} - 2 \, c^{2} d f^{2} + 2 \, {\left (3 \, c^{2} d f^{4} - d^{3} f^{2}\right )} x^{2} + 4 \, {\left (c^{3} f^{4} - c d^{2} f^{2}\right )} x\right )} \cos \left (f x + e\right ) - 120 \, {\left (i \, d^{3} f x + i \, c d^{2} f + {\left (i \, d^{3} f x + i \, c d^{2} f\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (i \, d^{3} f x + i \, c d^{2} f\right )} \cos \left (f x + e\right )\right )} {\rm Li}_2\left (-\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) - 120 \, {\left (-i \, d^{3} f x - i \, c d^{2} f + {\left (-i \, d^{3} f x - i \, c d^{2} f\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (-i \, d^{3} f x - i \, c d^{2} f\right )} \cos \left (f x + e\right )\right )} {\rm Li}_2\left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - 12 \, {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3} + {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + 1\right ) - 12 \, {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3} + {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (5 \, d^{3} f^{2} x^{2} + 10 \, c d^{2} f^{2} x + 5 \, c^{2} d f^{2} - 2 \, d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + 1\right ) - 120 \, {\left (d^{3} \cos \left (f x + e\right )^{2} + 2 \, d^{3} \cos \left (f x + e\right ) + d^{3}\right )} {\rm polylog}\left (3, -\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) - 120 \, {\left (d^{3} \cos \left (f x + e\right )^{2} + 2 \, d^{3} \cos \left (f x + e\right ) + d^{3}\right )} {\rm polylog}\left (3, -\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - 4 \, {\left (4 \, d^{3} f^{3} x^{3} + 12 \, c d^{2} f^{3} x^{2} + 4 \, c^{3} f^{3} - 6 \, c d^{2} f + 6 \, {\left (2 \, c^{2} d f^{3} - d^{3} f\right )} x + {\left (5 \, d^{3} f^{3} x^{3} + 15 \, c d^{2} f^{3} x^{2} + 5 \, c^{3} f^{3} - 6 \, c d^{2} f + 3 \, {\left (5 \, c^{2} d f^{3} - 2 \, d^{3} f\right )} x\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{12 \, {\left (a^{2} f^{4} \cos \left (f x + e\right )^{2} + 2 \, a^{2} f^{4} \cos \left (f x + e\right ) + a^{2} f^{4}\right )}} \]

input
integrate((d*x+c)^3/(a+a*sec(f*x+e))^2,x, algorithm="fricas")
 
output
1/12*(3*d^3*f^4*x^4 + 12*c*d^2*f^4*x^3 - 12*c^2*d*f^2 + 6*(3*c^2*d*f^4 - 2 
*d^3*f^2)*x^2 + 3*(d^3*f^4*x^4 + 4*c*d^2*f^4*x^3 + 6*c^2*d*f^4*x^2 + 4*c^3 
*f^4*x)*cos(f*x + e)^2 + 12*(c^3*f^4 - 2*c*d^2*f^2)*x + 6*(d^3*f^4*x^4 + 4 
*c*d^2*f^4*x^3 - 2*c^2*d*f^2 + 2*(3*c^2*d*f^4 - d^3*f^2)*x^2 + 4*(c^3*f^4 
- c*d^2*f^2)*x)*cos(f*x + e) - 120*(I*d^3*f*x + I*c*d^2*f + (I*d^3*f*x + I 
*c*d^2*f)*cos(f*x + e)^2 + 2*(I*d^3*f*x + I*c*d^2*f)*cos(f*x + e))*dilog(- 
cos(f*x + e) + I*sin(f*x + e)) - 120*(-I*d^3*f*x - I*c*d^2*f + (-I*d^3*f*x 
 - I*c*d^2*f)*cos(f*x + e)^2 + 2*(-I*d^3*f*x - I*c*d^2*f)*cos(f*x + e))*di 
log(-cos(f*x + e) - I*sin(f*x + e)) - 12*(5*d^3*f^2*x^2 + 10*c*d^2*f^2*x + 
 5*c^2*d*f^2 - 2*d^3 + (5*d^3*f^2*x^2 + 10*c*d^2*f^2*x + 5*c^2*d*f^2 - 2*d 
^3)*cos(f*x + e)^2 + 2*(5*d^3*f^2*x^2 + 10*c*d^2*f^2*x + 5*c^2*d*f^2 - 2*d 
^3)*cos(f*x + e))*log(cos(f*x + e) + I*sin(f*x + e) + 1) - 12*(5*d^3*f^2*x 
^2 + 10*c*d^2*f^2*x + 5*c^2*d*f^2 - 2*d^3 + (5*d^3*f^2*x^2 + 10*c*d^2*f^2* 
x + 5*c^2*d*f^2 - 2*d^3)*cos(f*x + e)^2 + 2*(5*d^3*f^2*x^2 + 10*c*d^2*f^2* 
x + 5*c^2*d*f^2 - 2*d^3)*cos(f*x + e))*log(cos(f*x + e) - I*sin(f*x + e) + 
 1) - 120*(d^3*cos(f*x + e)^2 + 2*d^3*cos(f*x + e) + d^3)*polylog(3, -cos( 
f*x + e) + I*sin(f*x + e)) - 120*(d^3*cos(f*x + e)^2 + 2*d^3*cos(f*x + e) 
+ d^3)*polylog(3, -cos(f*x + e) - I*sin(f*x + e)) - 4*(4*d^3*f^3*x^3 + 12* 
c*d^2*f^3*x^2 + 4*c^3*f^3 - 6*c*d^2*f + 6*(2*c^2*d*f^3 - d^3*f)*x + (5*d^3 
*f^3*x^3 + 15*c*d^2*f^3*x^2 + 5*c^3*f^3 - 6*c*d^2*f + 3*(5*c^2*d*f^3 - ...
 
3.1.16.6 Sympy [F]

\[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\frac {\int \frac {c^{3}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {d^{3} x^{3}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {3 c d^{2} x^{2}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {3 c^{2} d x}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx}{a^{2}} \]

input
integrate((d*x+c)**3/(a+a*sec(f*x+e))**2,x)
 
output
(Integral(c**3/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(d**3* 
x**3/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(3*c*d**2*x**2/( 
sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(3*c**2*d*x/(sec(e + f 
*x)**2 + 2*sec(e + f*x) + 1), x))/a**2
 
3.1.16.7 Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 4283 vs. \(2 (243) = 486\).

Time = 1.33 (sec) , antiderivative size = 4283, normalized size of antiderivative = 14.87 \[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\text {Too large to display} \]

input
integrate((d*x+c)^3/(a+a*sec(f*x+e))^2,x, algorithm="maxima")
 
output
-1/6*(3*c*d^2*e^2*((9*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^3/(co 
s(f*x + e) + 1)^3)/(a^2*f^2) - 12*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/ 
(a^2*f^2)) - 3*c^2*d*e*((9*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^ 
3/(cos(f*x + e) + 1)^3)/(a^2*f) - 12*arctan(sin(f*x + e)/(cos(f*x + e) + 1 
))/(a^2*f)) + 6*(3*(f*x + e)^2*cos(3*f*x + 3*e)^2 + 3*(f*x + e)^2*sin(3*f* 
x + 3*e)^2 + 3*(9*(f*x + e)^2 - 4)*cos(2*f*x + 2*e)^2 + 3*(9*(f*x + e)^2 - 
 4)*cos(f*x + e)^2 + 3*(9*(f*x + e)^2 - 4)*sin(2*f*x + 2*e)^2 + 3*(9*(f*x 
+ e)^2 - 4)*sin(f*x + e)^2 + 3*(f*x + e)^2 + 2*(3*(f*x + e)^2 + (9*(f*x + 
e)^2 - 2)*cos(2*f*x + 2*e) + (9*(f*x + e)^2 - 2)*cos(f*x + e) + 12*(f*x + 
e)*sin(2*f*x + 2*e) + 18*(f*x + e)*sin(f*x + e))*cos(3*f*x + 3*e) + 2*(9*( 
f*x + e)^2 + 3*(9*(f*x + e)^2 - 4)*cos(f*x + e) + 18*(f*x + e)*sin(f*x + e 
) - 2)*cos(2*f*x + 2*e) + 2*(9*(f*x + e)^2 - 2)*cos(f*x + e) - 10*(2*(3*co 
s(2*f*x + 2*e) + 3*cos(f*x + e) + 1)*cos(3*f*x + 3*e) + cos(3*f*x + 3*e)^2 
 + 6*(3*cos(f*x + e) + 1)*cos(2*f*x + 2*e) + 9*cos(2*f*x + 2*e)^2 + 9*cos( 
f*x + e)^2 + 6*(sin(2*f*x + 2*e) + sin(f*x + e))*sin(3*f*x + 3*e) + sin(3* 
f*x + 3*e)^2 + 9*sin(2*f*x + 2*e)^2 + 18*sin(2*f*x + 2*e)*sin(f*x + e) + 9 
*sin(f*x + e)^2 + 6*cos(f*x + e) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 
+ 2*cos(f*x + e) + 1) - 2*(10*f*x + 12*(f*x + e)*cos(2*f*x + 2*e) + 18*(f* 
x + e)*cos(f*x + e) - (9*(f*x + e)^2 - 2)*sin(2*f*x + 2*e) - (9*(f*x + e)^ 
2 - 2)*sin(f*x + e) + 10*e)*sin(3*f*x + 3*e) - 6*(6*f*x + 6*(f*x + e)*c...
 
3.1.16.8 Giac [F]

\[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\int { \frac {{\left (d x + c\right )}^{3}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \]

input
integrate((d*x+c)^3/(a+a*sec(f*x+e))^2,x, algorithm="giac")
 
output
integrate((d*x + c)^3/(a*sec(f*x + e) + a)^2, x)
 
3.1.16.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(c+d x)^3}{(a+a \sec (e+f x))^2} \, dx=\text {Hanged} \]

input
int((c + d*x)^3/(a + a/cos(e + f*x))^2,x)
 
output
\text{Hanged}